﻿<Page x:Class="EveMarkets.Views.Calculateur"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" Title="Calculateur" 
	  xmlns:my="clr-namespace:EveMarkets.UserControls"
      xmlns:EveMarketsDAO="clr-namespace:EveMarketsDAO;assembly=EveMarketsDAO" 
	  Height="Auto" Width="Auto">

    <Grid>
		<my:UcChoixItem HorizontalAlignment="Left" Margin="12,12,0,0" x:Name="ucChoixItem" VerticalAlignment="Top" />
		<Button Content="Calcul unitaire" Height="23" HorizontalAlignment="Left" Margin="256,42,0,0" Name="btnCalculUntaire" VerticalAlignment="Top" Width="90" Click="btnCalculUntaire_Click" />

		<my:UcChoixSysteme Height="265" HorizontalAlignment="Left" Margin="12,71,0,0" x:Name="ucChoixSystemeAchat" VerticalAlignment="Top" Width="200" />
		<my:UcChoixSysteme Height="265" HorizontalAlignment="Left" Margin="212,71,0,0" x:Name="ucChoixSystemeVente" VerticalAlignment="Top" Width="200" />

		<Rectangle Height="54" HorizontalAlignment="Left" Margin="12,366,0,0" Name="rectangle1" Stroke="Black" VerticalAlignment="Top" Width="91" />
		<CheckBox Content="Tech1" Height="16" HorizontalAlignment="Left" Margin="24,372,0,0" Name="checkBoxTech1" VerticalAlignment="Top" />
		<CheckBox Content="Tech2" Height="16" HorizontalAlignment="Left" Margin="24,394,0,0" Name="checkBoxTech2" VerticalAlignment="Top" />
		
		<Button Content="Calculer" Height="23" HorizontalAlignment="Left" Margin="119,372,0,0" Name="btnCalculer" VerticalAlignment="Top" Width="75" Click="btnCalculer_Click" />
		
		<Label Content="" Height="28" HorizontalAlignment="Left" Margin="214,366,0,0" Name="labelCalcul" VerticalAlignment="Top" />

		<DataGrid AutoGenerateColumns="False" HorizontalAlignment="Left" Margin="12,478,0,0" Name="dataGridResultatCalcul" VerticalAlignment="Top" Width="Auto" IsReadOnly="True" AlternatingRowBackground="#FF88FFFF" Height="Auto" MouseLeftButtonUp="MouseLeftButtonUp_Click" SelectionChanged="ChangementDeLigne">
			<DataGrid.ContextMenu>
				<ContextMenu Name="ctxDataGrid">
					<MenuItem Header="Voir les SellOrders." Click="ClickVoirSellOrder" />
					<MenuItem Header="View on Universe" Click="Click_ViewUniverse" />
					<MenuItem Header="Simulation" Click="ClickVoirSimulation" />
				</ContextMenu>
			</DataGrid.ContextMenu>
			<DataGrid.Columns>
				<DataGridTextColumn Header="Nom" Binding="{Binding LiensVers_invItemsTypes.typeName}" />
				<DataGridTextColumn Header="Date de calcul" Binding="{Binding DateCalcul}" />
				<DataGridTextColumn Header="Station Achat" Binding="{Binding staStationsAchat.stationName}"/>
				<DataGridTextColumn Header="Station Vente" Binding="{Binding staStationsVente.stationName}"/>
				<DataGridTextColumn Header="Coût production" Binding="{Binding CoutProd, StringFormat={}{0:N}}" />
				<DataGridTextColumn Header="Coût invention" Binding="{Binding CoutInvention, StringFormat={}{0:N}}" />
				<DataGridTextColumn Header="Percent Success" Binding="{Binding PctReussite, StringFormat={}{0:N}}" />
				<DataGridTextColumn Header="Prix Vente" Binding="{Binding PrixVente, StringFormat={}{0:N}}" />
				<DataGridTextColumn Header="Bénéfice" Binding="{Binding Benefice, StringFormat={}{0:N}}" />
				<DataGridTextColumn Header="Temps/Isk" Binding="{Binding TpsIsk, StringFormat={}{0:N}}" />
				<DataGridTextColumn Header="Temps Prod" Binding="{Binding TempProd}" />
				<DataGridTextColumn Header="Temps Invention" Binding="{Binding TempInvention}" />
			</DataGrid.Columns>
			<DataGrid.RowDetailsTemplate>
				<DataTemplate>
					<DataGrid ItemsSource="{Binding LienResultatsDetails}" AutoGenerateColumns="False" HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto" IsReadOnly="True" AlternatingRowBackground="#FF88FF44">
						<DataGrid.Columns>
							<DataGridTextColumn Header="Matériel" Binding="{Binding LienVers_invItemsTypes.typeName}" />
							<DataGridTextColumn Header="Quantité" Binding="{Binding Quantite, StringFormat={}{0:N}}"/>
							<DataGridTextColumn Header="Prix unitaire" Binding="{Binding PrixUnitaire, StringFormat={}{0:N}}"/>
							<DataGridTextColumn Header="Prix total" Binding="{Binding PrixTotal, StringFormat={}{0:N}}"/>
						</DataGrid.Columns>
					</DataGrid>
				</DataTemplate>
			</DataGrid.RowDetailsTemplate>
		</DataGrid>
		
		<ProgressBar Height="23" HorizontalAlignment="Left" Margin="119,409,0,0" Name="progressBarCalculMass" VerticalAlignment="Top" Width="200" />
		<GroupBox Header="Info item" Height="198" HorizontalAlignment="Left" Margin="418,16,0,0" Name="groupBoxItem" VerticalAlignment="Top" Width="200">
			<StackPanel Margin="6,6,6,6">
				<Label Content="Group name :" Height="28" Name="labelGroupName" />
				<TextBox Height="23" Name="textBoxGroupName" Width="145" />

				<Label Content="Mass :" Height="28" Name="labelMass" />
				<TextBox Height="23" Name="textBoxMass" Width="145" />

				<Label Content="Volume :" Height="28" Name="labelVolume" />
				<TextBox Height="23" Name="textBoxVolume" Width="145" />
			</StackPanel>
		</GroupBox>

		<GroupBox Header="Info Markets" Height="251" HorizontalAlignment="Left" Margin="418,220,0,0" Name="gBoxInfoMarkets" VerticalAlignment="Top" Width="200">
			<StackPanel  Margin="6,6,6,6">
				<Label Content="Price min :" Height="28" HorizontalAlignment="Left" Name="labelPriceMin" VerticalAlignment="Top" />
				<TextBox Height="23" Name="textBoxPriceMin" Width="145" />
				
				<Label Content="Price average :" Height="28" HorizontalAlignment="Left" Name="labelPriceAvg" VerticalAlignment="Top" />
				<TextBox Height="23" Name="textBoxPriceAvg" Width="145" />

				<Label Content="Price max :" Height="28" HorizontalAlignment="Left" Name="labelPriceMax" VerticalAlignment="Top" />
				<TextBox Height="23" Name="textBoxPriceMax" Width="145" />

				<Label Content="Stock :" Height="28" HorizontalAlignment="Left" Name="labelStock" VerticalAlignment="Top" />
				<TextBox Height="23" Name="textBoxStock" Width="145" />
			</StackPanel>
		</GroupBox>
		
		<GroupBox Header="Description" Height="455" HorizontalAlignment="Left" Margin="624,16,0,0" Name="gpDescription" VerticalAlignment="Top" Width="267">
			<Grid>
				<TextBox HorizontalAlignment="Left" Name="textBoxInfoDescription" VerticalAlignment="Top" TextWrapping="Wrap" TextAlignment="Justify" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" IsReadOnly="True" Height="432" Width="255" />
			</Grid>
		</GroupBox>
	</Grid>
</Page>
